//
//  StrategyDetailHeaderView.m
//  FreeTrip
//
//  Created by 邓芮 on 15/11/25.
//  Copyright © 2015年 邓芮. All rights reserved.
//

#import "StrategyDetailHeaderView.h"

@interface StrategyDetailHeaderView ()

@property (nonatomic, strong) UILabel *label;
// 标题
@property (nonatomic, strong) UILabel *title;

@end

@implementation StrategyDetailHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self)
    {
        CGFloat height = 50 * KScreenWidth / 414;
        CGFloat x = 10 * KScreenWidth / 414;
        CGFloat y = 5 * KScreenWidth / 414;
        CGFloat width = 3 * KScreenWidth/ 414;
        self.label = [[UILabel alloc]initWithFrame:CGRectMake(x, y, width, height - y * 2)];
        self.label.backgroundColor = [UIColor blackColor];
        [self.contentView addSubview:self.label];
        
        self.title = [[UILabel alloc]initWithFrame:CGRectMake(x + width + x, y, KScreenWidth - (x + width + x), height)];
        self.title.font = [UIFont systemFontOfSize:21 * KScreenWidth / 414];
        self.title.textAlignment = NSTextAlignmentLeft;
        self.title.textColor = [UIColor grayColor];
        [self.contentView addSubview:self.title];
        
    }
    return  self;
}

- (void)setModel:(StrategyModel *)model
{
    _model = model;
    self.title.text = model.title;
}

+ (CGFloat)heightForHeaderView
{
    return 50 * KScreenWidth / 414;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
